package com.itheima.demo04;

import java.util.*;
import java.util.stream.Stream;

public class Demo02 {

    public static void main(String[] args) {


        //Collection集合
        ArrayList<String> arrayList = new ArrayList<>();

        arrayList.add("qwe");
        arrayList.add("follow");
        arrayList.add("hello");

        arrayList.stream().filter(s -> s.length()==5).forEach(s -> System.out.println(s));

        System.out.println("---------------------------------------------------");


        //map集合
        Map<String,String> hashMap = new HashMap<>();

        hashMap.put("pdd","32");
        hashMap.put("write","34");
        hashMap.put("xuxu","33");

        Set<String> strings = hashMap.keySet();

        strings.stream().forEach(s ->{

            String s1 = hashMap.get(s);

            System.out.println(s+"-----"+s1);
        });


        System.out.println("---------------------------------------------------");


        //数组

        Stream.of(12,32,43,45).filter(s -> s>=32).forEach(s -> System.out.println(s));





    }
}
